﻿CREATE TABLE [dbo].[Tarefa] (
    [Id]           INT            IDENTITY (1, 1) NOT NULL,
    [IdQuadro]     INT            NOT NULL,
    [Tipo]         INT            DEFAULT ((1)) NOT NULL,
    [Status]       INT            DEFAULT ((1)) NOT NULL,
    [Descricao]    NVARCHAR (255) NOT NULL,
    [Arquivado]    BIT            DEFAULT ((0)) NOT NULL,
    [CriadoPor]    INT            NOT NULL,
    [Responsavel]  INT            NULL,
    [DataCadastro] DATETIME       DEFAULT (getdate()) NOT NULL,
    [Excluido]     BIT            DEFAULT ((0)) NOT NULL,
    [Posicao]      INT            NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_TarefaQuadro] FOREIGN KEY ([IdQuadro]) REFERENCES [dbo].[Quadro] ([Id]),
    CONSTRAINT [FK_ResponsavelTarefa] FOREIGN KEY ([Responsavel]) REFERENCES [dbo].[Usuario] ([Id]),
    CONSTRAINT [FK_TarefaCriadaPor] FOREIGN KEY ([CriadoPor]) REFERENCES [dbo].[Usuario] ([Id])
);

